Use $(PYTHON) Makefile variable when building the hypervisor.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 9 Jul 2009 14:26:24 +0000 (15:26 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 9 Jul 2009 14:26:24 +0000 (15:26 +0100)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen/include/Makefile
xen/tools/get-fields.sh

index 71cd172aa1cda7e26847f94e057e18d8fbcb9ff0..0223835c0871944638f9eed99183fac0fdf7501c 100644 (file)
@@ -52,7 +52,7 @@ compat/%.h: compat/%.i Makefile
        $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \
        $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \
        grep -v '^# [0-9]' $< | \
-       $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
+       $(PYTHON) $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \
        $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \
        echo "#endif /* $$id */" >>$@.new
        mv -f $@.new $@
@@ -63,10 +63,11 @@ compat/%.i: compat/%.c Makefile
 compat/%.c: public/%.h xlat.lst Makefile
        mkdir -p $(@D)
        grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \
-        $(BASEDIR)/tools/compat-build-source.py >$@.new
+       $(PYTHON) $(BASEDIR)/tools/compat-build-source.py >$@.new
        mv -f $@.new $@
 
 compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile
+       export PYTHON=$(PYTHON); \
        grep -v '^[      ]*#' xlat.lst | \
        while read what name hdr; do \
                $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \
index 9b2c61f1d0b68a30c6fe949a6bcae770ba5f7640..4547dc2eee01293471ca4a8a0b23fa276b2a7fb8 100644 (file)
@@ -5,6 +5,13 @@ SED=sed
 if test -x /usr/xpg4/bin/sed; then
        SED=/usr/xpg4/bin/sed
 fi
+if test -z ${PYTHON}; then
+       PYTHON=`/usr/bin/env python`
+fi
+if test -z ${PYTHON}; then
+       echo "Python not found"
+       exit 1
+fi
 
 get_fields ()
 {
@@ -129,7 +136,7 @@ handle_field ()
                fi
        elif [ -z "$(echo "$5" | $SED 's,[^{}],,g')" ]
        then
-               local tag=$(echo "$5" | python -c '
+               local tag=$(echo "$5" | ${PYTHON} -c '
 import re,sys
 for line in sys.stdin.readlines():
     print re.subn(r"\s*(struct|union)\s+(compat_)?(\w+)\s.*", r"\3", line)[0].rstrip()